package com.lhkj.ct.meta.modules.scheduling.model.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.lhkj.ct.base.enums.GlobalStatus;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;

import javax.validation.Valid;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 排班模板
 * </p>
 *
 * @author jobob
 * @since 2023-10-29
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="TblScheMould对象", description="排班模板")
public class TblScheMould implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "排班模板id")
    private String id;

    @NotNull(message = "请设置模板名称")
    @Length(max = 25, message = "模板名称不能超过{max}字符")
    @ApiModelProperty(value = "模板名称")
    private String name;

    @TableField(updateStrategy = FieldStrategy.IGNORED)
    @ApiModelProperty(value = "排除周几，多个“,”隔开")
    private String weekday;

    @NotNull(message = "请设置模板状态")
    @ApiModelProperty(value = "状态", notes = "0.正常 1.停用", example = "0", required = true)
    private GlobalStatus status;

    @Length(max = 255, message = "备注不能超过{max}字符")
    @ApiModelProperty(value = "备注")
    private String remark;

    @TableField(fill = FieldFill.INSERT)
    @ApiModelProperty(value = "创建人")
    private String createBy;

    @TableField(fill = FieldFill.INSERT)
    @ApiModelProperty(value = "创建时间")
    private LocalDateTime createTime;

    @TableField(fill = FieldFill.UPDATE)
    @ApiModelProperty(value = "修改人")
    private String updateBy;

    @TableField(fill = FieldFill.UPDATE)
    @ApiModelProperty(value = "修改时间")
    private LocalDateTime updateTime;

    @NotEmpty(message = "请至少设置一个模板时间段")
    @TableField(exist = false)
    @ApiModelProperty(value = "模板时间段")
    @Valid
    private List<TblScheMouldTime> times;
}
